<%@page import="domain.model.TrackIp"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<%@page import="domain.model.Whois"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%
String ips = (String) request.getAttribute("ips");
String title = (String) request.getAttribute("title");
String description = (String) request.getAttribute("description");
String keywords = (String) request.getAttribute("keyword");
List<TrackIp> ip = (List<TrackIp>)request.getAttribute("ip");
List<TrackIp> ipList = (List<TrackIp>)request.getAttribute("ipList");
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>
		<div class="bd al">
			<div class="bdl l">
				<form action="/search-ip" class="sea">
					<input type="text" name="name"/>
					<button>Lookup Ip</button>
					<br/>
					Example Searches : <a href="/ip/75.126.102.228">75.126.102.228</a> , <a href="/ip/67.228.81.180">67.228.81.180</a>
				</form>
				<h1 class="tt">Ip : <%=ip.get(0).getIp() %></h1>
				<ul class="detail_ip">
					<li>
						<div class="ip_left">ISP:</div>
						<div class="ip_right"><%=(ip.get(0).getJsp()!=null&&!ip.get(0).getJsp().equals(""))?ip.get(0).getJsp():"-" %></div>
					</li>
					<li>
						<div class="ip_left">Organization:</div>
						<div class="ip_right"><%=(ip.get(0).getOrganization()!=null&&!ip.get(0).getOrganization().equals(""))?ip.get(0).getOrganization():"-" %></div>
					</li>
					<li>
						<div class="ip_left">Proxy:</div>
						<div class="ip_right"><%=(ip.get(0).getProxy()!=null&&!ip.get(0).getProxy().equals(""))?ip.get(0).getProxy():"-" %></div>
					</li>
					<li>
						<div class="ip_left">Type:</div>
						<div class="ip_right"><%=(ip.get(0).getType()!=null&&!ip.get(0).getType().equals(""))?ip.get(0).getType():"-" %></div>
					</li>
					<li>
						<div class="ip_left">Assignment:</div>
						<div class="ip_right"><%=(ip.get(0).getAssignment()!=null&&!ip.get(0).getAssignment().equals(""))?ip.get(0).getAssignment():"-" %></div>
					</li>
					<li>
						<div class="ip_left">Country:</div>
						<div class="ip_right"><%=(ip.get(0).getCountry()!=null&&!ip.get(0).getCountry().equals(""))?ip.get(0).getCountry():"-" %></div>
					</li>
					<li>
						<div class="ip_left">State/Region:</div>
						<div class="ip_right"><%=(ip.get(0).getState()!=null&&!ip.get(0).getState().equals(""))?ip.get(0).getState():"-" %></div>
					</li>
					<li>
						<div class="ip_left">City:</div>
						<div class="ip_right"><%=(ip.get(0).getCity()!=null&&!ip.get(0).getCity().equals(""))?ip.get(0).getCity():"-" %></div>
					</li>
				</ul>
				<ul class="li">
					<%
					if(ipList.size()>0)
					{
						for(int i=0;i<ipList.size();i++)
						{
					%>
							<li><a href="/ip/<%=ipList.get(i).getIp() %>"><%=ipList.get(i).getIp() %></a></li>
					<%
						}
					}
					%>
				</ul>
				<div class="cl"></div>
				<br/>
				<h2 class="td">Other sites hosted on <%=ip.get(0).getIp() %></h2>
				<ul class="li">
					<%=(request.getAttribute("sameip") != null && !request.getAttribute("sameip").equals(""))?request.getAttribute("sameip"):"Unknown" %>
				</ul>
				<div class="cl"></div>
				<br/>
				<h2 class="td">Whois ip : <%=ip.get(0).getIp() %></h2>
				<div class="whois_ip">
					<%=(ip.get(0).getWhoisIp()!=null)?ip.get(0).getWhoisIp().getValue():"" %>
				</div>
			</div>
			<div class="bdr r">
				<h2>Your ip : <font><%=ips %></font></h2>
				<%@ include file='/adv/right250.jsp'%>
				<%@ include file='/element/menu_left.jsp'%>
			</div>
			<div class="cl"></div>
		</div>
<%@ include file='/layout/footer.jsp'%>